import request from '@/utils/request'

//用户创建数据
export function userCreate(data) {
    return request({
      url: '/users/create',
      method: 'post',
      data:data
    })
  }
//用户通过id修改数据
export function userUpdate(id,data) {
    return request({
      url: '/users/update/'+id,
      method: 'put',
      data:data
    })
  }
//删除多个多条数据(传递字符串)
export function userRemoves(data) {
    return request({
      url: '/users/removes',
      method: 'delete',
      data:{ids:data.toString()}
    })
  }
//删除单条数据
export function userDelete(id) {
  // console.log(id.getters)
    return request({
      url: '/users/delete/'+id,
      method: 'delete'
    })
  }
//获取传递过来的id的数据
export function userListId(id) {
    return request({
      url: '/users/list/'+id,
      method: 'get'
    })
  }
  //获取有页码字段的所有数据
export function userListPage(data) {
  return request({
    url: '/users/list',
    method: 'post',
    data:data
  })

}
//获取所有--没有页码数据
export function userList() {
    return request({
      url: '/users/lm',
      method: 'post'
    })
  }

  //登录接口放置在用户api
  export function userLogin(data) {
    return request({
      url: '/login',
      method: 'post',
      data:data
    })
  }